﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLGameCore.Utility;
using DLGameCore.GameModel.State;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace DLGameCore.Controller
{
    public interface IGameManager
    {
        void intialize();
        void render(GameTime gameTime, SpriteBatch spriteBatch, GraphicsDevice graphicsDevice);
        void release();
    }
    public enum EState {
        GAME_INIT,
        RESOURCE_LOADING,
        GAME_TRAILER,
        MAIN_MENU, 
        MAP_SELECTION, 
        MAP_EDITOR,
        GAME_OPTION,
        GAME_CONTINUE, 
        GAME_ABOUT, 
        STAGE_START,
        STAGE_PLAY,
        STAGE_END,
        GAME_OVER
    }
    public abstract class GameManager:IGameManager
    {
        private EState _EState;

        public EState EState
        {
            get { return _EState; }
            set { _EState = value; gameState=controlState(); }
        }


        public List<CGameState> gameStates = new List<CGameState>();
        public CGameState gameState;

        public virtual CGameState controlState()
        {
            return null;
        }
        public void intialize()
        {
            EState = EState.GAME_INIT;
        }
        public void render(GameTime gameTime, SpriteBatch spriteBatch, GraphicsDevice graphicsDevice)
        {
            gameState.play(gameTime,spriteBatch,graphicsDevice);
        }
        public void release()
        {
        }
    }
}
